variable "exist_azs" {
  type = list(string)
  default = []
}

variable "exist_vswitch_ids" {
  type = list(string)
  default = []
}

variable "number_of_instances" {
  default = "1"
}

variable "count_format" {
  default = "%02d"
}

variable "image_id" {
  default = "centos_7_9_x64_20G_alibase_20211227.vhd"
}

variable "user_data" {
  description = "User data to pass to instance on boot."
  type        = string
  default     = <<EOF
#cloud-config

ssh_authorized_keys:
  - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAGEA3FSyQwBI6Z+nCSjUUk8EEAnnkhXlukKoUPND/RRClWz2s5TCzIkd3Ou5+Cyz71X0XmazM3l5WgeErvtIwQMyT1KjNoMhoJMrJnWqQPOt5Q8zWd9qG7PBl9+eiH5qV7NZ mykey@host
  - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA3I7VUf2l5gSn5uavROsc5HRDpZdQueUq5ozemNSj8T7enqKHOEaFoU2VoPgGEWC9RyzSQVeyD6s7APMcE82EtmW4skVEgEGSbDc1pvxzxtchBj78hJP6Cf5TCMFSXw+Fz5rF1dR23QDbN1mkHs7adr8GW4kSWqU7Q7NDwfIrJJtO7Hi42GyXtvEONHbiRPOe8stqUly7MvUoN+5kfjBM8Qqpfl2+FNhTYWpMfYdPUnE7u536WqzFmsaqJctz3gBxH9Ex7dFtrxR4qiqEr9Qtlu3xGn7Bw07/+i1D+ey3ONkZLN+LQ714cgj8fRS4Hj29SCmXp5Kt5/82cD/VN3NtHw== smoser@brickies
  - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDA4MaBu1ohOzH5ZPKa0Rmotno9ABjj0ZrAKrRmVU6afovRetHInOuOoTgnaHTpzjvj9KiF1Sd4l6opv+PYNwWebXLJWoc1F6UpznZ2JF58H5syHrf49lW66SyT4grQjuHfInfhAieSk2fd18Lw+k34kJbtjvW3dkZbukkJYQYmxix44boyzt+2v+itghpt0VdPmexc0a+pmaaGyexFJpn+GqoRMY1V+tlP0i8ay+rX7UczSVQQlbugPbU/KZwjrrDfc47bsVF4Zy93Nxn6WFao5CGsoK/Rk9f3F3+CASeuULDAFe8Nrfdo4xiW4qSUugZYZKDBFhUnFXaFsYfNH6T/ root@scm
  - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC4YSr6DOd1cuLUzvcMLV2/sNQ65Zmc8AzSVpY6QbSz485tDkQkJ5jUFSw01Z0T5DkEXAnOt6ecRzJs9e71V+qG7uAKw4GPLG6A2eysdlaA7jJkgp4M43rlPM35yKnO6VKgG+f+H9oTdGm6y7VotADcRkpUV7RnwnlDGCG+64zi2xlWFdnmPgwheYu0tj5AqpfOuIEuMaOl9c16IOVgLJ+NShjoQsLyCc/+op6Md8TVEk6gol7xMQvimgdQdSv715fdhNtejOffPQLtl1VlLQGBLA7Q03H5QOGDiZSExghrpSsVmNU8VrVKBUZvV8yjfpjSilSrfbVzK/rsxIBFPHAB root@master01
write_files:
  - content: |
      15 * * * * root ship_logs
    path: /etc/crontab
    append: true
bootcmd:
  - echo "Hello World. The time is now $(date -R)!" | tee /root/userdata_test.txt
runcmd:
  - rpm -ivh https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm
  - rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
  - yum install -y mysql-community-client.x86_64 wget git
EOF
}

variable "role" {
  default = "work"
}

variable "name" {
  description = "Name to be used on all resources as prefix. Default to 'TF-Module-ECS-Instance'. The final default name would be TF-Module-ECS-Instance001, TF-Module-ECS-Instance002 and so on."
  type        = string
  default     = ""
}

variable "host_name" {
  description = "Host name used on all instances as prefix. Like if the value is TF-ECS-Host-Name and then the final host name would be TF-ECS-Host-Name001, TF-ECS-Host-Name002 and so on."
  type        = string
  default     = ""
}

variable "short_name" {
  default = "hi"
}

variable "ecs_type" {
  default = "ecs.n4.small"
}

variable "ecs_password" {
  default = "Test12345"
}

variable "internet_charge_type" {
  default = "PayByTraffic"
}

variable "instance_charge_type" {
  type = string
  default = "PostPaid"
}

variable "instance_type" {
  type = string
  default = ""
}

variable "instance_type_family" {
  type = string
  default = "ecs.n1"
}

variable "cpu_core_count" {
  type = number
  default = 1
}

variable "memory_size" {
  type = number
  default = 1
}

variable "use_num_suffix" {
  description = "Always append numerical suffix(like 001, 002 and so on) to instance name and host name, even if number_of_instances is 1."
  type        = bool
  default     = false
}

variable "internet_max_bandwidth_out" {
  default = 10
}

variable "associate_public_ip_address" {
  description = "Whether to associate a public ip address with an instance in a VPC."
  type        = bool
  default     = false
}

variable "system_disk_category" {
  description = "The system disk category used to launch one or more ecs instances."
  type        = string
  default     = "cloud_efficiency"
}

variable "system_disk_size" {
  description = "The system disk size used to launch one or more ecs instances."
  type        = number
  default     = 40
}

variable "disk_category" {
  default = "cloud_efficiency"
}

variable "disk_size" {
  default = "40"
}

variable "disk_count" {
  default = "1"
}

variable "nic_type" {
  default = "intranet"
}

variable "private_ip" {
  type = string
  default = ""
}

variable "private_ips" {
  description = "A list to configure Instance private IP address"
  type        = list(string)
  default     = []
}

variable "private_key" {
  default = ""
}

variable "key_name" {
  default = ""
}

variable "vswitch_id" {
  type = string
  default = ""
}

variable "security_groups" {
  description = "A list of security group ids to associate with."
  type = list(string)
  default = []
}

variable "virtual_server_group" {
  default = []
}

variable "content" {
  type = string
  default = ""
}

variable "setup_db" {
  type = bool
  default = true
}

variable "rds_connection_string" {
  type = string
  default = ""
}

variable "rds_port" {
  type = number
  default = 3306
}

variable "rds_username" {
  type = string
  default = ""
}

variable "rds_passpwrd" {
  type = string
  default = ""
}

variable "triggers" {
  type = list(string)
  default = []
}
